<template>
	<view class="item_list" :style="[pad,bgcC]"
	:hover-class="clickBg?'hoverClassList':''">
		<view class="left">
			<text class="left_text">{{title}}</text>
		</view>
		<view class="right">
			<view class="right_content">
				<slot name="rContent"></slot>
			</view>
			<slot name="right">
				<text class="icon iconfont">&#xe65f;</text>
			</slot>
		</view>
	</view>
</template>

<script setup>
	import { computed } from 'vue'
	const props = defineProps({
		title:{
			type:String,
			require:true,
			default:'标题'
		},
		clickBg:{
			type:Boolean,
			default:true
		},
		px: {
			type: Number,
			default: 10
		},
		bgc: {
			type: String,
			default: '#fff'
		}
	})
	const pad = computed(() => { // 设置内边距
		return `padding:20rpx ${props.px}rpx;`
	})
	
	const bgcC = computed(() => { // 设置背景色
		return `background-color: ${props.bgc};`
	})
</script>

<style lang="less" scoped>
	.item_list{
		display: flex;
		flex-direction: row;
		align-items: center;
		padding: 30rpx;
		border-bottom: 1rpx solid #f5f5f5;
		border-top: 1rpx solid #f5f5f5;		background-color: #fff;
		.left{
			width: 150rxp;
			.left_text{
				font-size: 30rpx;
				color: #333;
			}
		}
		.right{
			flex: 1;
			display: flex;
			flex-direction: row;
			justify-content: flex-end;
			align-items: center;
			.right_content{
				flex: 1;
			}
		}
	}
</style>